//
//  RiskEnsureHeaderView.m
//  WBBaseProject
//
//  Created by xiaozhi on 2018/4/10.
//  Copyright © 2018年 吴斌. All rights reserved.
//

#import "RiskEnsureHeaderView.h"
#import <YYText.h>

@implementation RiskEnsureHeaderView

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/
- (void)setType:(RiskType)type
{
    _type = type;
    switch (_type) {
        case RiskTypeNone:{
            
            
            break;
        }
        case RiskTypeEffected:{
            
            self.backView.hidden = NO;
            self.startBtn.hidden = YES;
            
            self.descLb.hidden = YES;
            self.typeImg.image = [UIImage imageNamed:@"保障1拷贝2"];
            
            NSMutableAttributedString *text = [[NSMutableAttributedString alloc]initWithString:@"256元"];
            
            [text yy_setFont:WB_FontSize(13) range:NSMakeRange(text.length-1, 1)];
            
            
            self.dayLb.attributedText = text;
            
            [self.backView mas_updateConstraints:^(MASConstraintMaker *make) {
                
                make.top.equalTo(self.notiLb).offset(60);
            }];
            break;
        }
        case RiskTypeRefund:{
            
            self.backView.hidden = NO;
            self.startBtn.hidden = YES;
            
            self.notiLb.hidden = YES;
            
            self.dayLb.text = @"退款中";
            self.timeLb.text = @"预计到账时间 2018-04-15";
            break;
        }
        default:
            break;
    }
}
- (IBAction)start:(id)sender {
    if (self.startClick) {
        self.startClick();
    }
}

@end
